using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Threading;
using System.Drawing.Drawing2D;
using Rocket.Windows.Framework.Utilities;
using Rocket.Core;

namespace Rocket.Windows.Framework
{
    public class BaseForm : Form
    {
        public GradientPanel panelTitle;
        public Label labelTitle;
        protected GradientLabel labelMessage;

        public void SetMessage(string mesg, MessageTypes type)
        {
            this.labelMessage.Text = mesg;
            this.labelMessage.Visible = true;
            this.labelMessage.MessageType = type;
            this.labelMessage.Location = new Point((this.Width - this.labelMessage.Width) / 2, 55);
            this.labelMessage.BringToFront();
        }

        public Image LogoImage
        {
            get { return this.labelTitle.Image; }
            set { this.labelTitle.Image = value; }
        }
        public void HideMessage()
        {
            this.labelMessage.Visible = false;
        }

        public BaseForm()
        {
            InitializeComponent();
        }

        protected void InitializeComponent()
        {
            this.panelTitle = new Rocket.Windows.Framework.Utilities.GradientPanel();
            this.labelMessage = new Rocket.Windows.Framework.Utilities.GradientLabel();
            this.labelTitle = new System.Windows.Forms.Label();
            this.panelTitle.SuspendLayout();
            this.SuspendLayout();
            // 
            // panelTitle
            // 
            this.panelTitle.BorderColor = System.Drawing.Color.DarkGray;
            this.panelTitle.Controls.Add(this.labelTitle);
            this.panelTitle.Dock = System.Windows.Forms.DockStyle.Top;
            this.panelTitle.GradientEndColor = System.Drawing.Color.PaleGreen;
            this.panelTitle.GradientStartColor = System.Drawing.SystemColors.Control;
            this.panelTitle.Image = null;
            this.panelTitle.ImageLocation = new System.Drawing.Point(4, 4);
            this.panelTitle.Location = new System.Drawing.Point(0, 0);
            this.panelTitle.Name = "panelTitle";
            this.panelTitle.Size = new System.Drawing.Size(284, 55);
            this.panelTitle.TabIndex = 1;
            // 
            // labelMessage
            // 
            this.labelMessage.Anchor = System.Windows.Forms.AnchorStyles.Top;
            this.labelMessage.AutoSize = true;
            this.labelMessage.BackColor = System.Drawing.Color.Transparent;
            this.labelMessage.BorderColor = System.Drawing.Color.Black;
            this.labelMessage.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.labelMessage.ForeColor = System.Drawing.Color.Black;
            this.labelMessage.GradientEndColor = System.Drawing.Color.Magenta;
            this.labelMessage.GradientStartColor = System.Drawing.Color.Yellow;
            this.labelMessage.Image = null;
            this.labelMessage.ImageLocation = new System.Drawing.Point(4, 4);
            this.labelMessage.Location = new System.Drawing.Point(12, 9);
            this.labelMessage.MessageType = Rocket.Core.MessageTypes.InfomationDisplay;
            this.labelMessage.Name = "labelMessage";
            this.labelMessage.Padding = new System.Windows.Forms.Padding(5, 5, 10, 10);
            this.labelMessage.ShadowOffSet = 3;
            this.labelMessage.Size = new System.Drawing.Size(79, 29);
            this.labelMessage.TabIndex = 0;
            this.labelMessage.Text = "Message";
            this.labelMessage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            this.labelMessage.Visible = false;
            // 
            // labelTitle
            // 
            this.labelTitle.BackColor = System.Drawing.Color.Transparent;
            this.labelTitle.Dock = System.Windows.Forms.DockStyle.Top;
            this.labelTitle.Image = global::Rocket.Windows.Framework.Properties.Resources.RocketLogoSmall2;
            this.labelTitle.ImageAlign = System.Drawing.ContentAlignment.TopLeft;
            this.labelTitle.Location = new System.Drawing.Point(0, 0);
            this.labelTitle.Name = "labelTitle";
            this.labelTitle.Size = new System.Drawing.Size(284, 55);
            this.labelTitle.TabIndex = 0;
            this.labelTitle.Text = "Feature Demonstration    \r\n";
            this.labelTitle.TextAlign = System.Drawing.ContentAlignment.BottomRight;
            // 
            // BaseForm
            // 
            this.ClientSize = new System.Drawing.Size(284, 264);
            this.Controls.Add(this.panelTitle);
            this.Controls.Add(this.labelMessage);
            this.Name = "BaseForm";
            this.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10);
            this.Load += new System.EventHandler(this.BaseForm_Load);
            this.panelTitle.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        private void BaseForm_Load(object sender, EventArgs e)
        {
            this.panelTitle.SendToBack();
        }
    }
}
